package com.ytjj.qmyx.mall.mapper;

import com.ytjj.qmyx.mall.model.*;
import org.apache.ibatis.annotations.MapKey;
import org.apache.ibatis.annotations.Param;

import java.math.BigDecimal;
import java.util.List;
import java.util.Map;

public interface OrdersInfoMapper {
    long countByExample(OrdersInfoExample example);

    int deleteByExample(OrdersInfoExample example);

    int deleteByPrimaryKey(Integer id);

    List<OrdersInfo> selectOrderInfoByOrderId(Integer orderId);

    List<OrdersInfoFreightDto> selectOrdersInfoFreightDto(String childOrderNo);

    int insert(OrdersInfo record);

    int insertSelective(OrdersInfo record);

    List<OrdersInfo> selectByExampleWithBLOBs(OrdersInfoExample example);

    List<OrdersInfo> selectByExample(OrdersInfoExample example);

    OrdersInfo selectByPrimaryKey(Integer id);

    List<OrdersInfo> selectByPrimary(Integer id);

    OrdersInfo selectByExpressNo(String expressNo);

    int updateByExampleSelective(@Param("record") OrdersInfo record, @Param("example") OrdersInfoExample example);

    int updateByExampleWithBLOBs(@Param("record") OrdersInfo record, @Param("example") OrdersInfoExample example);

    int updateByExample(@Param("record") OrdersInfo record, @Param("example") OrdersInfoExample example);

    int updateByPrimaryKeySelective(OrdersInfo record);

    int updateByPrimaryKeyWithBLOBs(OrdersInfo record);

    int updateByPrimaryKey(OrdersInfo record);

    List<Orders> selectZeroEvaluationOrder(Integer userId, Integer productId);

    int updateOrderStatusByExpressEno(String expressEno);

    void deleteByOrderId(Integer orderId);

    Integer selectorderId(String orderNo);

    List<OrdersInfo> select(Integer unfilledOrderDay);

    List<OrdersInfo> selectBetween(Integer unfilledOrderDay);

    List<OrdersInfo> selectByLimit(Integer unfilledOrderDay, Integer limitIndex, Integer pageSize);

    Integer selectCount(Integer unfilledOrderDay);

    BigDecimal selectByChildOrderNo(String childOrderNo);

    OrdersInfo queryByChildOrderNo(@Param("childOrderNo") String childOrderNo);

    /**
     * 查询30天内正在售后订单
     */
    List<OrdersInfo> selectByAfterType();

    List<OrdersInfo> selectByChildOrderNoList(@Param("childOrderNos") List<String> childOrderNos);

    Integer selectStatusById(String childOrderNo);

    void updateByIds(@Param("list")List<Integer> orderInfoIds);

    Integer selectIsRefund(Integer id);

    List<OrdersInfo> getAllOrdersInfoByOrderId(Integer orderId);

    void updateErrorOrderRemark(@Param("orderIds") List<Integer> orderIds);

    int updateOrderInfoProductSpec(@Param("orderInfoId") Integer orderInfoId,
                                   @Param("productSpecId") Integer productSpecId,
                                   @Param("productSkuSpec") String productSkuSpec);

    int updateOrderSpec(@Param("orderId") Integer orderId,
                        @Param("productSkuSpec") String productSkuSpec);

    /**
     * 根据支付单号获取子订单号
     * @param tradeNo
     * @return
     */
    String queryChildOrderNoByTradeNo(@Param("tradeNo") String tradeNo);

    /**
     * 根据支付单号查询订单商品
     * @param tradeNo
     * @return
     */

    ComplaintsOrderResponse queryPlatformData(@Param("tradeNo") String tradeNo);

    /**
     * 根据支付单号查询订单商品
     * @param tradeNos
     * @return
     */
    List<ComplaintsOrderResponse> queryPlatformDataList(@Param("tradeNos") List<String> tradeNos);

    int addMarkRerturn(Integer orderInfoId,String childOrderNo,String adminName);

    int deleteMarkRerturn(String childOrderNo);

}